package org.easy.tool.controller;

import org.easy.tool.common.R;
import org.easy.tool.service.IUserTrain;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.LinkedHashMap;

/**
 * <p>
 *  前端控制器
 * </p>
 *
 * @author Valley
 * @since 2025-06-16 20:51:13
 */
@RestController
@RequestMapping("/userTrain")
public class UserTrainController {

    @Autowired
    IUserTrain service;

    @RequestMapping("study")
    public R study(@RequestBody(required = false)LinkedHashMap data) throws Exception {
        return R.ok(service.study(data));
    }

    @RequestMapping("judgeBlankAnswer")
    public R judgeBlankAnswer(@RequestBody(required = false)LinkedHashMap data) throws Exception {
        return R.ok(service.judgeBlankAnswer(data));
    }

    @RequestMapping("submitTrain")
    public R submitTrain(@RequestBody(required = false)LinkedHashMap data) throws Exception {
        return R.ok(service.submitTrain(data));
    }

    @RequestMapping("getUserTrainSummary")
    public R getUserTrainSummary(@RequestBody(required = false)LinkedHashMap data) throws Exception {
        return R.ok(service.getUserTrainSummary(data));
    }

}
